using SimpleFramework;

public class CfgRole : IIdxEntity
{
    public int Id { get; private set; }           //#编号
    public string Name { get; private set; }      //名称
    public string Icon { get; private set; }      //图标
    public int Level { get; private set; }        //等级
    public int MaxLife { get; private set; }      //最大生命值
    public int LifeDrain { get; private set; }    //生命窃取%
    public int MeleeDamage { get; private set; }  //近战伤害
    public int RangedDamage { get; private set; } //远程伤害
    public int MagicDamage { get; private set; }  //元素伤害
    public int Damage { get; private set; }       //伤害
    public int Defense { get; private set; }      //护甲
    public int AttackSpeed { get; private set; }  //攻击速度
    public int CritChane { get; private set; }    //暴击率
    public int AttackRange { get; private set; }  //攻击范围
    public int DodgeChance { get; private set; }  //闪避
    public int MoveSpeed { get; private set; }    //速度
    public int Buildability { get; private set; } //统帅
    public int LuckPoint { get; private set; }    //幸运
    public int Harvest { get; private set; }      //收获

    public int GetKey()
    {
        return this.Id;
    }

    public void Read(DataBufferReader reader)
    {
        this.Id = reader.ReadInt32();
        this.Name = reader.ReadString();
        this.Icon = reader.ReadString();
        this.Level = reader.ReadInt32();
        this.MaxLife = reader.ReadInt32();
        this.LifeDrain = reader.ReadInt32();
        this.MeleeDamage = reader.ReadInt32();
        this.RangedDamage = reader.ReadInt32();
        this.MagicDamage = reader.ReadInt32();
        this.Damage = reader.ReadInt32();
        this.Defense = reader.ReadInt32();
        this.AttackSpeed = reader.ReadInt32();
        this.CritChane = reader.ReadInt32();
        this.AttackRange = reader.ReadInt32();
        this.DodgeChance = reader.ReadInt32();
        this.MoveSpeed = reader.ReadInt32();
        this.Buildability = reader.ReadInt32();
        this.LuckPoint = reader.ReadInt32();
        this.Harvest = reader.ReadInt32();
    }
}
